//nodejs 使用 require 引入模块
var http = require('http');

//创建服务器
http.createServer(function (request, response) {
    //发送http头
    //http状态值200: ok 内容类型: text/plain
    response.writeHead(200, {'Content-Type': 'text/plain'});

    response.end('hello world\n');
}).listen(8888);

//终端打印
console.log('server run at port 8888');